package com.itheima.test5;

public class Test {
    public static void main(String[] args) {
        goSwimming(new Swimming() {
            @Override
            public void swim() {
                System.out.println("去游泳");
            }
        });
    }

    public static void goSwimming(Swimming swimming){
        swimming.swim();
       /* Swimming swimming1 = new Swimming() {
            @Override
            public void swim() {
                System.out.println("去游泳");
            }
        };*/
    }
}

interface Swimming{
    void swim();
}

